// src/main/ets/routes/Routes.ts
export default class Routes {
  // 路由常量定义
  static readonly INDEX = 'Index';
  static readonly LOGIN = 'Login';
  static readonly REGISTER = 'Register';
  static readonly HOME = 'Home';
  static readonly TODO_LIST = 'TodoList';
  static readonly SECOND = 'Second';

  // 获取所有路由数组
  static getRoutes(): string[] {
    return [
      this.INDEX,

      this.LOGIN,
      this.REGISTER,
      this.HOME,
      this.TODO_LIST,
      this.SECOND
    ];
  }

  // 新增：获取页面路径映射（步骤三建议添加）
  static getPageMap(): Record<string, string> {
    return {
      [this.INDEX]: 'pages/Index',

      [this.LOGIN]: 'pages/Login',
      [this.REGISTER]: 'pages/Register',
      [this.HOME]: 'pages/Home',
      [this.TODO_LIST]: 'pages/TodoList',
      [this.SECOND]: 'pages/Second'
    };
  }

  // 新增：路由参数类型定义（步骤三建议添加）
  static getRouteParams(routeName: string): Record<string, any> {
    const paramsMap: Record<string, Record<string, any>> = {
      [this.SECOND]: { from: '' },
      [this.LOGIN]: { redirect: false }
      // 为其他路由添加默认参数...
    };
    return paramsMap[routeName] || {};
  }
}